package com.globant.placemaps;

import com.globant.common.BusinessSettings;

import android.app.Dialog;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends FragmentActivity  {

	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
	public Dialog onCreateDialog(int id) {
    	
		Dialog dialog = new Dialog(this);
		dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
		
		dialog.setContentView(R.layout.error_dialog);
		TextView messageError = (TextView) dialog.findViewById(R.id.messageError);
		messageError.setText(getResources().getString(R.string.error_add));

		Button ok = (Button) dialog.findViewById(R.id.ok);
		ok.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				dismissDialog(BusinessSettings.ERROR_DIALOG);
			}
		});

		return dialog;
	}
}
